package com.glq1218.rental.controller;

import com.glq1218.domain.R;
import com.glq1218.domain.RentalResult;
import com.glq1218.rental.service.RentalService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author glq1218
 * @description TODO
 * @since 2023/4/26 14:06
 */
@RestController
@RequestMapping("/api/rental")
@RequiredArgsConstructor
public class RentalController {
    private final RentalService rentalService;

    @PostMapping("/rentalArticle")
    public R<RentalResult> rental(@RequestBody Map<String, Long> params) {
        return R.ok(rentalService.rental(params.get("id")));
    }
}
